using System.Collections;
using System.Collections.Generic;
using PixelCrushers.DialogueSystem;
using UnityEngine;
using XFGameFramework;
using XFGameFramework.SkillSystem;

public class 翅膀扇击 : TakeDamageBase
{
    public int theSkillId = 10002;
    Module module = ModuleManager.GetModule("MainModule");
    private SkillConfig SkillConfig => XFABManager.AssetBundleManager.LoadAsset<SkillConfig>(module.ModuleName, "SkillConfig");
     private PlayerController playerController => module.LoadController<PlayerController>();
    private SkillController skillController => module.LoadController<SkillController>();
    private SkillConfig skillConfig => XFABManager.AssetBundleManager.LoadAsset<SkillConfig>(module.ModuleName, "SkillConfig");

    //初始化
    public 翅膀扇击(RolesModel creator, RolesModel target,int id) : base(creator, target,id)
    {

    }


    public override void ApplyAction()
    {
        base.ApplyAction();
        if (target == null)
        {
            Debug.LogError("没有目标");
        }
        if (creator == null)
        {
            Debug.LogError("没有创建者");
        }
        List<int> skillList = skillController.GetSkillList(creator);
        
        foreach (int skillId in skillList)
        {
            if (skillId == theSkillId)
            {
                skillController.skillCDUP(creator, skillId, SkillConfig.GetSkillInfo(skillId).cooling_rounds);
                LogUtil.Log("翅膀扇击技能CD上升: {0}",creator.skillsCD[skillList.IndexOf(skillId)]);
                break;
                                
            }
        }
        
        翅膀扇击 翅膀扇击 = new 翅膀扇击(creator, target,theSkillId);
        
        翅膀扇击.ComputeDamage();
    }
    public override int CalculateDamage(int baseDamage, RolesModel target)
    {

        int finalDamage = playerController.CurrentStrength;    
        Debug.Log("翅膀扇击伤害：" + finalDamage);
        return finalDamage;
    }
}
